package com.sh.data.engine.common.annotation.permissionCheck;

import com.sh.data.engine.common.enumDefinition.PermissionCheckEnum;
import com.sh.data.engine.common.enumDefinition.RoleEnum;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

import java.lang.annotation.*;

/**
 * 权限检查注解
 */
@Documented
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Order(Ordered.HIGHEST_PRECEDENCE)
public @interface PermissionCheckMethod {
    // 需要具备的权限
    PermissionCheckEnum value() default PermissionCheckEnum.NONE;

    // 允许的角色
    RoleEnum[] roles() default {};
}
